package com.itheima.controller;

import com.itheima.utils.Result;
import jakarta.servlet.http.HttpSession;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class SessionController {
    @GetMapping("setSession")
    public Result setSession(HttpSession session) {
        session.setAttribute("dingzhen", "aaa");
        return Result.success();
    }
    @GetMapping("getSession")
    public Result getSession(HttpSession session) {
        Object dingzhen = session.getAttribute("dingzhen");
        log.info("session:{}",dingzhen);
        return Result.success();
    }


}
